Open
Conversation
|
|
||
| fruit_pack = ['яблоко', 'банан', 'киви', 'арбуз'] | ||
| for i in range(0, len(fruit_pack)): | ||
| print(str(i + 1) + '.' + '{:>7}'.format(fruit_pack[i])) |
There was a problem hiding this comment.
подумайте что будет если в списке окажется слово которое будет по длине больше чем 7 символов
Comment on lines
+26
to
+30
| first_pack = ['1', '2', '3', '4', '5', '6', '7'] | ||
| second_pack = ['1', '3', '6'] | ||
| for item in second_pack: | ||
| if item in first_pack: | ||
| first_pack.remove(item) |
There was a problem hiding this comment.
вангую, ваше решнеие не будет работать на следующих данных:
first_pack = ['1', '1', '2', '3', '3', '4', '5', '6', '6', '7']
second_pack = ['1', '3', '6']
Comment on lines
+38
to
+44
| for key in dic_days: | ||
| if date_check[0] == key: | ||
| date_check[0] = dic_days[key] | ||
|
|
||
| for key in dic_months: | ||
| if date_check[1] == key: | ||
| date_check[1] = dic_months[key] |
There was a problem hiding this comment.
у вас данные уже в словаре лежат, не нужно по ним итерироваться чтобы достать значения по ключу
| if date_check[1] == key: | ||
| date_check[1] = dic_months[key] | ||
|
|
||
| print(date_check[0] + ' ' + date_check[1] + ' ' + date_check[2] + ' ' "года") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Выполнил задания easy и normal